<template>
	<view class="container">
		<view class="goods-details" v-if="activityDetail.content">
			<rich-text :nodes="activityDetail.content" :data-nodes="activityDetail.content"></rich-text>
		</view>
		<view class="footer fixfooter" :class="{ 'bottom-safe-area': isIphoneX }">
			<view class="submit" @click="goTo()">立即预约</view>
		</view>
	</view>
</template>

<script>
    import htmlParser from '@/common/js/html-parser';
	export default {
		data() {
			return {
				isIphoneX: false, //判断手机是否是iphoneX以上
				id: '',
				activityDetail: {}
			}
		},
		onLoad(data) {
			this.isIphoneX = this.$util.uniappIsIPhoneX()
			this.getDetail();
		},
		methods: {
			goTo() {
				this.$util.redirectTo('/otherpages/food/custome')
			},
			getDetail() {
				this.$api.sendRequest({
			      url: "/api/food/detail",
			      data: {},
			      success: res => {
			        if(res.code == 0) {
			         this.activityDetail = res.data;
					
					  // 商品详情
					  if (this.activityDetail.content) this.activityDetail.content = htmlParser(this.activityDetail.content);
					
			        }else {
						this.$util.showToast({title:res.message});
					}
			      }
			    })
			},
		}
	}
</script>

<style lang="scss" scoped>
.container {
	padding-bottom: 0;
}
</style>
